home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GRPHRSLT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  455 b   |  19 lines

  1. #include <stdio.h>
  2. #include <graphics.h>
  3.  
  4. main()
  5. {
  6.     int graphdriver = DETECT, graphmode, errorcode;
  7. /* Generate an error by calling initgraph with
  8.  * wrong pathname for device drivers
  9.  */
  10.     initgraph(&graphdriver, &graphmode, "c:\\");
  11.     errorcode = graphresult();
  12.     if(errorcode != 0)
  13.     {
  14.        printf("Graphics error!");
  15.        printf("Error code is %d\n", errorcode);
  16.     }
  17.     else
  18.        printf("No error detected\n");
  19. }